home *** CD-ROM | disk | FTP | other *** search
/ Network Supervisor's Toolkit / Network Supervisor's Toolkit.iso / tools / pcmenu21 / pcmenu.txt < prev    next >
Text File  |  1996-07-10  |  34KB  |  1,055 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.                                                PcMenu
  12.  
  13.                                             Version 2.1
  14.  
  15.                                           Reference Manual
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.               Brian Habel   1992
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.                                     Legal Stuff
  38.  
  39.           Grant  of Rights
  40.           THIS SOFTWARE IS COPYRIGHT AND ALL RIGHTS ARE RESERVED! 
  41.           The Author of PcMenu  V2.1 hereby grants  you the right to  use
  42.           this software at no charge,  with exception to the restrictions
  43.           below.
  44.  
  45.           Restrictions
  46.           You may not Sell this software  without the written  permission
  47.           from the author.
  48.  
  49.           Limitations of Liability
  50.           This software  is distributed AS IS,  and the  author cannot be
  51.           held responsible,  and will not be  liable to  you for damages,
  52.           including  any  loss   of  profits,  lost  savings,  or   other
  53.           incidental or consequential damages arising out of your use  of
  54.           this  software, even  if  the author  has  been advised  of the
  55.           possibility of such damage.
  56.  
  57.           Redistribution
  58.           You  may  redistribute this software  providing that, No Profit
  59.           is  attained,   and,  that    this   notice  and   all  of  its
  60.           accompanying  material, including all  files and  programs, are
  61.           distributed together,  whether it  be by  electronic media,  or
  62.           Bulletin Board Service.
  63.  
  64.           THE  USE OF  THIS SOFTWARE  INDICATES  YOUR  ACCEPTANCE OF  THE
  65.           TERMS OUTLINED ABOVE !
  66.  
  67.           Comments
  68.           For  those users  who have Internet  access, you  can send your
  69.           comments,      sugestions      and     bug      reports      to
  70.           PcMenu@arcadia.mc.phillip.edu.au.
  71.  
  72.           Credits
  73.           This  software   was  written  by   Brian  Habel,  a   computer
  74.           programmer who is employed  at the Bundoora Campus of the Royal
  75.           Melbourne Institute of Technology. 
  76.  
  77.           NOTICE
  78.           NOVELL and  NETWARE are  registered trademarks  of Novell  Inc.
  79.           Provo Utah  U.S.A
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.                                    Introduction
  89.  
  90.           What is PcMenu
  91.  
  92.           PcMenu   is   a   software    package   which   allows   System
  93.           Administrators, Managers  of Local Area  Networks, or even  the
  94.           lone home user of  a standalone system to organise the software
  95.           on there system so that it can easily accessed.
  96.  
  97.           This is achieved  by creating customised  screen menu's  from a
  98.           series of menu scripts, that  are small ascii text  files which
  99.           define  the contents of  each menu.   A menu  can lead to other
  100.           menus,  referred  to   as  sub-menus,  allowing  the  user   or
  101.           administrator to organise software in a variety of  ways.
  102.  
  103.           PcMenu is fully  compatible with NOVELL's NETWARE MENU  utility
  104.           'menu  script'  files.  Users of  PcMenu  in  a NOVELL  Network
  105.           environment  can easily  install  PcMenu  as the  scripts  from
  106.           NOVELL's menu  utility work in the  same way.   Although PcMenu
  107.           may  be NOVELL compatible,  it has even more  to offer, as such
  108.           storing  sub-menus in  other files from where  they are called.
  109.           Also,  an optional  screen saver has  been added  to reduce the
  110.           chance of 'burn on'. PcMenu even  has mouse support!  With  the
  111.           Paldef  utility you  can even choose  what colour  you want for
  112.           your menus. 
  113.  
  114.           PcMenu  runs options  in  DOS via  Batch  Files with  no memory
  115.           overhead !  Yes,  you can even load Terminate and Stay Resident
  116.           (TSR) type programs with PcMenu. Why,  I hear you ask?  Simply,
  117.           because  PcMenu does NOT shell as it runs its options,  it runs
  118.           them under the Primary Command Processor.
  119.  
  120.           You may like to  think of PcMenu  as a batch file  database and
  121.           each menu  option is  the link  to its  associated batch  file.
  122.           Now  there is no need  to have plethora of  batch files roaming
  123.           your system as all files can be integrated into one!
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.           Page 3                      PcMenu Version 2.1 Reference Manual
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.                                  How To Use PcMenu
  153.  
  154.           Planning your menus
  155.  
  156.                Some  thought must  be  considered in  what a  menu should
  157.                contain.   This all  depends on  who is going  to be using
  158.                the  system and  what  environment the  user  is in.   For
  159.                example,  a user  in  an  educational environment  may  be
  160.                using PC's  connected via  a local area network.  This may
  161.                mean that the user may  need to access various  amounts of
  162.                information  from various  software  packages.   One  plan
  163.                might  be  to  group all  common  software  packages  into
  164.                groups,  say all  'Word Processors' in one  group, and all
  165.                'Spread  Sheets'  in  another.  These  groups  could  then
  166.                become each  in them selves a  sub-menu which  can then be
  167.                accessed from a main menu.  Another plan might be to  sort
  168.                the  software  packages  on a  most  used  basis.  Placing
  169.                options for these in the  first main menu, and  other less
  170.                frequently used software packages in sub-menus. 
  171.  
  172.           Defining your Menus 
  173.  
  174.                As mentioned  before, PcMenu  uses the  same technique  as
  175.                the  NOVELL NETWARE  Menu  utility.  Those users  who  are
  176.                familiar with the NOVELL NETWARE Menu  utility should have
  177.                little  difficulty in  designing and  implementing  menu's
  178.                scripts for PcMenu.
  179.  
  180.                Essentially,  each  menu has  a  Title  and  at least  one
  181.                option up to  an upper limit of fifty.    A  complete menu
  182.                definition has the following form.
  183.  
  184.           %menu_title[,[row_placement][,[column_placement][,palette]]]
  185.           Menu Option 
  186.                     |
  187.           Dos Batch file commands
  188.                     |
  189.                     OR
  190.           %sub-menu_title[,alternative_filename]
  191.  
  192.  
  193.                Looking at this in more detail, each menu definition
  194.                starts with the % character which must appear in the
  195.                first column of the file, followed directly by the title
  196.                of this menu.  The title here will be the title that is
  197.                displayed in the title area of your menu.  Following the
  198.                title there are several optional values that may be added
  199.                for this menu. The first two of these are associated with
  200.                the location on the screen you want the menu to be
  201.                displayed and the third option is the palette number
  202.                which defines the colour of the menu. These options will
  203.                be discussed in more detail later.
  204.  
  205.  
  206.  
  207.  
  208.  
  209.           PcMenu Version 2.1 Reference Manual                      Page 4
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.                On the following lines appear the options that appear in
  219.                the menu. Each option that you wish to add, must again
  220.                start in the first column of the file and as before, what
  221.                you type here is displayed as your option in the menu. 
  222.                The next lines are what action is to be taken for this
  223.                option.  They usually consist of standard DOS batch file
  224.                commands.  Each Batch file command must be offset by at
  225.                least a space. That is it must start in at least the
  226.                second column of the menu definition file.  You may find
  227.                by using the tab character to space DOS batch file
  228.                commands,  you can keep your menu options more distinct
  229.                from each other. PcMenu will continue reading batch file
  230.                commands for this option until it finds the next option
  231.                title, which should be located in the first column.
  232.  
  233.                Alternatively, instead of a batch file command, you can
  234.                place a % character and immediately following, the name
  235.                of another menu definition. This creates a link to what
  236.                is known as a sub-menu.  You can have sub-menus located
  237.                in a different file if you wish, in which case you add
  238.                after the sub-menu name the complete DOS PATH of the
  239.                filename in which this sub-menu is contained separated by
  240.                a comma.
  241.  
  242.                Example:
  243.  
  244.                %Brian's Computer
  245.                Word Processors
  246.                     %Word Processors Menu
  247.                Dos Command
  248.                     echo off
  249.                     @"Enter your DOS command"
  250.                %Word Processors Menu,,,2
  251.                Word Perfect 5.1
  252.                     echo off
  253.                     c:\wp51
  254.                     wp
  255.                     cd c:\
  256.                PC  Write
  257.                     echo off
  258.                     cd c:\pcwrite
  259.                     ed
  260.                     cd c:\
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.           Page 5                      PcMenu Version 2.1 Reference Manual
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.                This menu definition file contains a main menu (entitled
  284.                'Brian's Computer')  and one sub-menu ( entitled 'Word
  285.                Processors Menu' ).  The main menu uses default values
  286.                for menu location and palette colour. The sub-menu uses
  287.                default the menu location but uses the user defined
  288.                palette colour 2. The main menu would display something
  289.                like the following.
  290.  
  291.                                 ╔═════════════════╗
  292.                                 ║  Brian's Menu   ║
  293.                                 ╠═════════════════╣
  294.                                 ║ Word Processors ║
  295.                                 ║ PCWrite         ║
  296.                                 ╚═════════════════╝
  297.  
  298.                                Fig 1.  Example Menu
  299.  
  300.                Notice that  the menu title is  centred on  the screen. If
  301.                you do not  want the title centred  , it must be  enclosed
  302.                in double  quotation marks,. The menu  title will then  be
  303.                left justified. 
  304.  
  305.                Also note that  menu items are not sorted  alphabetically.
  306.                Menu items  appear in  the menu   in the  same order  they
  307.                appear in the menu definition file.
  308.  
  309.                IMPORTANT
  310.                Sub-menus located  in alternate  files will  only load  if
  311.                that file is  accessible. If the alternate file cannot  be
  312.                found or read THE ENTIRE  MENU ENTRY FOR THIS  OPTION WILL
  313.                NOT BE DISPLAYED.  That  is, if PcMenu cannot load a  sub-
  314.                menu  from an  alternate  file  then  it will  ignore  the
  315.                entire  option  from  the  current  menu  definition  when
  316.                displayed. ( If  you cant read the option definition,  why
  317.                display an option  to the user  ).   On the  other hand if
  318.                the sub-menu definition is  made and no  alternate file is
  319.                allocated, the sub-menu definition must be  located in the
  320.                current file otherwise an error will result.
  321.  
  322.                Network  administrators, might  see some  exploitation  in
  323.                this feature!
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.           PcMenu Version 2.1 Reference Manual                      Page 6
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.           Locating Your Menus On The Screen
  349.  
  350.                By  default, if  there  are  no optional  values  supplied
  351.                after the menu title  name for a menu definition, the menu
  352.                will be  displayed in the middle  of the  screen. To place
  353.                the menu  in a different  location you  supply two  values
  354.                which adjust the  horizontal and vertical position of  the
  355.                menu.  Lines  are measured from the  top of the screen  to
  356.                the centre of the menu  in the horizontal plane,  and from
  357.                the sides of the  screen to the centre of the menu  in the
  358.                vertical  plane. So  to calculate  the  final position  of
  359.                your menu apply the following formula.
  360.  
  361.                                         A + B/2 = C
  362.                          where
  363.                               A    = the number of lines above the menu
  364.  
  365.                               B/2  =  half  the number  of  lines in  the
  366.                               menu counting the borders and title
  367.  
  368.                               C    = row_placement value
  369.  
  370.                and  for  the  column_placement  value  re-use   the  same
  371.                formula above except
  372.                this time A, B, and C represent:-
  373.  
  374.                               A    = the  number of  columns to  the left
  375.                               of the menu
  376.  
  377.                               B    = half the column width of the menu
  378.  
  379.                               C    = column_placement value 
  380.  
  381.                If you  make the placement values  too large  or too small
  382.                the menu  will be  positioned at  the appropriate edge  of
  383.                the screen. You need not  worry about moving the  menu off
  384.                the screen. If  the placement values  are ZERO  or omitted
  385.                they  revert back  to default  values, the  centre of  the
  386.                screen for that plain ( horizontal / vertical ) .
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.           Page 7                      PcMenu Version 2.1 Reference Manual
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412.           Using Your Mouse With PcMenu
  413.  
  414.                PcMenu supports  any Microsoft  Compatible mouse  conected
  415.                to your system!
  416.  
  417.                While the  mouse pointer ( indicated by the red block ) is
  418.                over a  menu option, pressing  the left  button once  will
  419.                move the highlight bar to that option.  Pressing the mouse
  420.                button twice in rapid succession will  select that option.
  421.                ( As if the Enter key had been pressed ).
  422.  
  423.                While  the mouse  pointer is  over  any part  of a  menu (
  424.                including  the menu  title or any  of the  menu borders ),
  425.                pressing the right  mouse buttion will remove the  current
  426.                menu and return  to the previous one.  ( Or will exit  the
  427.                program if this was the 'top level' menu. )
  428.  
  429.                By  placing the  menu  pointer  on the  horizontal  border
  430.                above the  top menu item display, pressing the left button
  431.                will cause the highlight   bar to scroll through  the list
  432.                of options 'up-wards'.  Likewise, if the mouse pointer  is
  433.                positioned at the horizontal menu border  beneath the last
  434.                menu  option  displayed,  pressing  the  left button  will
  435.                cause  the highlight   bar to  scroll through  the list of
  436.                options 'down-wards'. 
  437.  
  438.                The  Paldef utility  uses  the mouse  in  the same  way as
  439.                PcMenu does.
  440.  
  441.           How To Colour Your Menus 
  442.  
  443.                You colour  your  menus  with the  PalDef  Utility.   This
  444.                utility will  let you define  up to  fifty extra palettes.
  445.                Palette 0 is 'Hard Wired'  into the program and  cannot be
  446.                changed.  This is  the  default palette  you get  when  no
  447.                palette number is specified. 
  448.  
  449.                To define a palette with the  Paldef utility, simply  move
  450.                the bar onto the  palette number you  wish to define.   To
  451.                the  right  you can  see the  current definition  for that
  452.                palette  in  the  Current  Palette  Definition  Menu.  The
  453.                colour it displays  is the existing colour definition  for
  454.                this palette.  To  change the definition  press the  Enter
  455.                key (  or click twice with the  left mouse button when the
  456.                pointer is  over the palette  you wish  to change ).   You
  457.                will then  be asked whether you  would like  to change the
  458.                Menu foreground or  background colour or whether you  want
  459.                to change  the colour  of the  select bar.   By  selecting
  460.                either foreground  or  background and  pressing the  Enter
  461.                key  you will  be presented with  a list  of valid colours
  462.                for that option.  Simply select  the colour  you want  and
  463.                hit the  return key.  The  Example Menu  then reflects the
  464.                choice you  have made.   If  you are  satisfied with  your
  465.                changes  simply press  the Escape key  to exit  out of the
  466.                menus.  ( If  you  are using  the mouse  you can  exit the
  467.                active  menu by  placing the  mouse  pointer  over it  and
  468.  
  469.           PcMenu Version 2.1 Reference Manual                      Page 8
  470.  
  471.  
  472.  
  473.  
  474.  
  475.  
  476.  
  477.                clicking once with the right button ).
  478.  
  479.  
  480.  
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.           Page 9                      PcMenu Version 2.1 Reference Manual
  535.  
  536.  
  537.  
  538.  
  539.  
  540.  
  541.  
  542.  
  543.                To save your  palette definitions simply press the  Escape
  544.                key from  the Palette list Menu  and you  will be prompted
  545.                as  to whether  you  would like  to  save your  changes or
  546.                abandon them.
  547.  
  548.           NOTE
  549.                The  PalDef Utility  looks  for  the file  containing  the
  550.                palette  colour  information  called  PCMU$PAL.DAT in  the
  551.                current  directory, unless  the  DOS  environment variable
  552.                PCMENU_PALETTE is defined, in which case  it will look  in
  553.                the  directory  specified  by this  variable.  (  See  the
  554.                section   titled   'Installation  and   Implementation  of
  555.                PcMenu' for more information ).
  556.  
  557.                If  the file  PCMU$PAL.DAT  does  not exist  PcMenu,  will
  558.                create the file  when loaded for the first  time ( as will
  559.                the PalDef  Utility). In  this case,  all palettes  except
  560.                palette  0 will  be Black print  on a  White background. (
  561.                This  enables users  of monochrome  screens  to  set up  a
  562.                color scheme that works!! )
  563.  
  564.  
  565.     ┌─────────────────────────────────────────────────────────────────────────┐
  566.     │ PalDef Ver 2.0   Copyright (c) 1989-92 Brian Habel ALL RIGHTS RESERVED  │
  567.     └─────────────────────────────────────────────────────────────────────────┘
  568.                                                         ╔═══════════════════╗
  569.     ╔═══════════════╗  ╔═════════════════════════════╗  ║ Forground Colors  ║
  570.     ║   Palettes    ║  ║  Color Selection For Menu   ║  ╠═══════════════════╣
  571.     ╠═══════════════╣  ╠═════════════════════════════╣  ║ │ Black           ║
  572.     ║ │ Palette 1   ║  ║ │  Menu   Forground         ║  ║ │ Blue            ║
  573.     ║ │ Palette 2   ║  ║ │  Menu   Background        ║  ║ │ Green           ║
  574.     ║ │ Palette 3   ║  ║ │  Menu   Select Bar        ║  ║ │ Cyan            ║
  575.     ║ │ Palette 4   ║  ╚═════════════════════════════╝  ║ │ Red             ║
  576.     ║ │ Palette 5   ║                                   ║ │ Magenta         ║
  577.     ║ │ Palette 6   ║                                   ║ │ Brown           ║
  578.     ║ │ Palette 7   ║                                   ║ │ White           ║
  579.     ║ │ Palette 8   ║                                   ║ │ Dark Grey       ║
  580.     ║ │ Palette 9   ║                                   ║ │ Light Blue      ║
  581.     ║ │ Palette 10  ║ ╔══════════════════════════════╗  ║ │ Light Green     ║
  582.     ║ │ Palette 11  ║ ║  Current Palette Definition  ║  ║ │ Light Cyan      ║
  583.     ║ │ Palette 12  ║ ╠══════════════════════════════╣  ║ │ Light Red       ║
  584.     ║ │ Palette 13  ║ ║ │     Option One             ║  ║ │ Light Magenta   ║
  585.     ║ │ Palette 14  ║ ║ │     Option Selected        ║  ║ │ Light Yellow    ║
  586.     ║ │ Palette 15  ║ ║ │     Option Three           ║  ║ │ Bright White    ║
  587.     ╚═══════════════╝ ╚══════════════════════════════╝  ╚═══════════════════╝
  588.                                                                              
  589.     <Esc> Exit Window     Choose Item   ┘ Select Item Tue Sep 22,1992 12:14:15
  590.  
  591.                     Fig. 2  Screen Layout of the Paldef Utility
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.           PcMenu Version 2.1 Reference Manual                     Page 10
  600.  
  601.  
  602.  
  603.  
  604.  
  605.  
  606.  
  607.  
  608.           More On Batch File Programming
  609.  
  610.                Normally, you can place any batch file command in the
  611.                Menu definition file you like when defining a menu
  612.                option.  There are however some special characters that
  613.                can be used to enhance your option.
  614.  
  615.                PcMenu does support the use of @ variable characters as
  616.                used in the NETWARE Menu utility. These characters allow
  617.                you to ask the user for further information
  618.                interactively, which will then be added to the batch file
  619.                when executed.  The syntax is as follows.
  620.  
  621.                          @[n]"prompt text"
  622.  
  623.                where n is the repeater or variable number of this
  624.                prompt.  If no variable number is supplied then the user
  625.                supplied  information cannot be reused later within the
  626.                batch file definition.
  627.  
  628.                In the following example a menu option has been created
  629.                to copy files
  630.  
  631.                COPY A FILE
  632.                  copy @1"Enter source file name" @2"Enter destination"
  633.                  echo @1 copied to @2
  634.  
  635.                The first line uses the DOS copy command. The first @
  636.                command asks the user for the pathname of the source file
  637.                and the second for the destination.
  638.  
  639.                To fully understand how PcMenu Implements @ variables,
  640.                you are encouraged to experiment a little and to look at
  641.                the runtime batchfile that is generated.
  642.  
  643.                PcMenu also supports the use of < > symbols for
  644.                retrieving values from the DOS environment.  You may use
  645.                these in menu title names and menu option names.  You
  646.                cannot use them when writing Batch file commands, instead
  647.                use the standard DOS Batch file % characters instead.
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.           Page 11                     PcMenu Version 2.1 Reference Manual
  665.  
  666.  
  667.  
  668.  
  669.  
  670.  
  671.  
  672.  
  673.                For example suppose you have a choice between two
  674.                printers, one called Document and the other called Draft.
  675.                If you set environment variables with the DOS SET command
  676.                as follows
  677.  
  678.                      SET OTHER_PRINTER=Document
  679.                      SET CURR_PRINTER=Draft
  680.  
  681.                then you can have a Menu Option defined as
  682.  
  683.                Change printer to <OTHER_PRINTER>
  684.                     capture q=%curr_printer%
  685.                     set tmp=%other_printer%
  686.                     set other_printer=%curr_printer%
  687.                     set curr_printer=%tmp%
  688.  
  689.                Then as this option is selected it will 'swap' the values
  690.                of the two DOS environment variables and also the menu
  691.                option will display the unselected printer.
  692.  
  693.                NOTE
  694.                With DOS you may use the @ character to suppress
  695.                statements from being displayed and the < > symbols for
  696.                file redirection. With PcMenu the @, <, >, characters
  697.                have special meanings.  In PcMenu the < > characters are
  698.                use to define DOS environment variables for Menu Titles
  699.                and Menu Options.  These characters retain there file
  700.                redirection function in the DOS BATCH definition area of
  701.                the Menu Definition file.  The @ character, on the other
  702.                hand, cannot be used a the DOS statement suppression
  703.                character, as it has a special meaning to PcMenu
  704.                throughout the entire Menu Definition file.
  705.  
  706.                There is little reason to use @ characters as statement
  707.                suppresses as they can be used in the startup batch file
  708.                in conjunction with the bathfile 'echo off' command.  (
  709.                See the section below entitled 'How it all works' )
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.           PcMenu Version 2.1 Reference Manual                     Page 12
  730.  
  731.  
  732.  
  733.  
  734.  
  735.  
  736.  
  737.           PcMenu's Information Box
  738.  
  739.                A nice feature of PcMenu is the Information Box.  If you
  740.                create a file called PCMU$HDR.DAT and place text in it,
  741.                It will be displayed at the top of the screen inside the
  742.                Copyright Information Box.  This allows System
  743.                Administrators of Networks to Display Important messages
  744.                to users in a moments notice.  Also you can tell PcMenu
  745.                to get different Header Information files for different
  746.                users by setting the a DOS environment variable called
  747.                PCMENU_HEADER to the directory in which PCMU$HDR.DAT is
  748.                located for that user.
  749.  
  750.                You can change the colour of the Information Box by a
  751.                series of colour codes. 
  752.  
  753.                To change the colour of the Information Box from its
  754.                default the first line of the file PCMU$HDR.DAT must
  755.                contain a combination of the following:-)
  756.  
  757.                          $bn  -    To change the background colour to
  758.                                    colour  n.
  759.  
  760.                          $fn  -    To change the foreground colour to
  761.                                    colour  n.
  762.  
  763.                          $sn  -    To change the borders of the
  764.                                    Information Box to colour  n.
  765.  
  766.                          ( Where  n   is  a digit  corresponding to its
  767.                          assigned colour as defined in the table blow )
  768.  
  769.  
  770.                This then in effect sets up a new set of colour defaults.
  771.  
  772.                To change the colour during a line of text you can use
  773.                the following :-)
  774.  
  775.                          @fn  -    To change the foreground colour to
  776.                                    colour  n.
  777.  
  778.                          @bn  -    To change the background colour to
  779.                                    colour  n.
  780.  
  781.                          ( Where  n   is  a digit  corresponding to its
  782.                          assigned colour as defined in the table blow )
  783.  
  784.                This enables you to change the colour of text  'on the
  785.                fly', so to speak, which will allow you to create
  786.                colourful message!
  787.  
  788.                NOTE
  789.                Background colour numbers must be between the range of  0
  790.                ≤ n ≥ 7
  791.                whereas, foreground colours must be within the range of 
  792.                0 ≤ n ≥ 15 .
  793.  
  794.           Page 13                     PcMenu Version 2.1 Reference Manual
  795.  
  796.  
  797.  
  798.  
  799.  
  800.  
  801.  
  802.                Colours numbers are defined as follows 
  803.  
  804.  
  805.                               Information Box Colour
  806.                                       Numbers
  807.                                 0          Black
  808.  
  809.                                 1          Blue 
  810.  
  811.                                 2          Green
  812.                                 3          Cyan
  813.  
  814.                                 4           Red
  815.  
  816.                                 5         Magenta
  817.                                 6          Brown
  818.  
  819.                                 7       Light Gray
  820.  
  821.                                 8        Dark Gray
  822.                                 9       Light Blue
  823.  
  824.                                 10      Light Green
  825.  
  826.                                 11      Light Cyan
  827.  
  828.                                 12       Light Red
  829.                                 13     Light Magenta
  830.  
  831.                                 14        Yellow
  832.  
  833.                                 15         White
  834.  
  835.                                 Fig 3. Colour Table
  836.  
  837.                Text is automatically centred unless quoted with double
  838.                quotes, in which case, text will be left justified and
  839.                placement of words can be calculated manually.
  840.  
  841.                You can also use the < > symbols to place the value of
  842.                any  DOS environment variable within a line as well.
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.           PcMenu Version 2.1 Reference Manual                     Page 14
  860.  
  861.  
  862.  
  863.  
  864.  
  865.  
  866.  
  867.  
  868.                Example
  869.                The following is an example of a PcMenu Information Box
  870.                Definition file  (PCMU$HDR.DAT).
  871.  
  872.                $b1$f15$s14                   - 
  873.                @f2H@f3e@f4l@f5l@f6o @f2T@f3h@f4e@f5r@f6e    
  874.  
  875.                ( The first line sets up the Information Box with a Blue
  876.                background, white foreground, with a yellow border.  The
  877.                second line will print the string 'Hello There'  in a
  878.                multitude of colours - a rainbow effect if you like )
  879.  
  880.                IMPORTANT
  881.  
  882.                When deciding on the location of Menus you count the top
  883.                of the screen as the first line immediately below the
  884.                Information Box!
  885.  
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900.  
  901.  
  902.  
  903.  
  904.  
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.           Page 15                     PcMenu Version 2.1 Reference Manual
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.  
  932.  
  933.           Installation and Implementation of PcMenu
  934.  
  935.                To install PcMenu choose create a new directory (
  936.                preferably ) on your hard disk ( or if running a network
  937.                on your servers hard disk ). For illustration purposes we
  938.                will choose the directory name of C:\PCMENU.
  939.  
  940.                Copy PCMENU.EXE, PALDEF.EXE and MENU.BAT in this
  941.                directory and place this directory in your path.
  942.  
  943.                PcMenu uses a series of DOS Environment Variables to tell
  944.                it where its files are. These are as follows:-
  945.  
  946.                MENU           - Used only by MENU.BAT and defines the
  947.                               directory and filename of the PcMenu
  948.                               Definition File.
  949.  
  950.                PCMENU_PALETTE - Defines the Directory where Paldef and
  951.                               PcMenu is to find the colour palette file
  952.                               PCMU$PAL.DAT
  953.  
  954.                PCMENU_TEMP         - Defines the Directory where PcMenu
  955.                                    finds its temporary file when
  956.                                    reloading after executing a DOS batch
  957.                                    file. The file is called PCMU$TMP.DAT
  958.  
  959.                PCMENU_HEADER  - Defines the Directory where PcMenu looks
  960.                               for the Information Box definition file
  961.                               PCMU$HDR.DAT
  962.  
  963.                PCMENU_BATCH        - Defines the Directory where PcMenu
  964.                                    writes the DOS Batch file for the
  965.                                    selected option.  The MENU.BAT batch
  966.                                    file also uses this DOS Environment
  967.                                    Variable.
  968.  
  969.                DOS Environment Variables can be set in the AUTOEXEC.BAT 
  970.                file or from login scripts within a network environment.
  971.  
  972.                If any of the environment variables are not set then
  973.                PcMenu ( and PalDef for the PCMENU_PALETTE variable )
  974.                will look for files in the current directory, the instant
  975.                they require it!  It is recommended that all variables be
  976.                set.
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.           PcMenu Version 2.1 Reference Manual                     Page 16
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.  
  998.           How it all works
  999.  
  1000.                PCMENU.EXE is not usually invoke from the command line,
  1001.                rather the entire system is driven from a DOS batch file
  1002.                called MENU.BAT of which a listing is made below:-
  1003.  
  1004.                     @echo off
  1005.                     pcmenu %MENU% /s300
  1006.                     if errorlevel 1 goto error
  1007.                     %PCMENU_BATCH%\PCMU$BAT.BAT
  1008.                     :error
  1009.  
  1010.  
  1011.                This file will load PcMenu with the Menu Definition File
  1012.                located in the path defined in MENU.  In this example
  1013.                PcMenu has been invoked with a screen saver time value of
  1014.                5 minutes.
  1015.  
  1016.                When an option is selected from a menu, and that option
  1017.                contained DOS Batch file code ( ie. not a sub-menu ),
  1018.                PcMenu will write the batch file code to the file
  1019.                PCMU$BAT.BAT ( in the directory defined by PCMENU_BATCH )
  1020.                and record which menu and option that was selected by
  1021.                creating a temporary file in the directory defined by the
  1022.                DOS environment variable PCMENU_TEMP. PcMenu then exits
  1023.                back to MENU.BAT where the next instruction will execute
  1024.                the newly created batch file and hence the option just
  1025.                selected. After completion, MENU.BAT is re-executed (
  1026.                this is done from PCMU$BAT.BAT ), and PcMenu is reloaded,
  1027.                and upon detecting the presence of the temporary file
  1028.                created earlier, will restore its state to the instant
  1029.                before the option was selected.
  1030.  
  1031.  
  1032.  
  1033.  
  1034.  
  1035.  
  1036.  
  1037.  
  1038.  
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.           Page 17                     PcMenu Version 2.1 Reference Manual
  1055.